package com.timoon.sample.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.timoon.component.panel.jqgrid.JqGridParameter;
import com.timoon.sample.dao.PassageDAO;
import com.timoon.sample.dao.model.Passage;
import com.timoon.sample.dao.model.PassageExample;
import com.timoon.sample.utils.SystemConfig;
import com.timoon.webcomponent.utility.titlelist.list.TitleListService;

/**
 *<p></p>
 *<p></p>
 *<p>Copyright:Copyright(c)2013</p>
 *<p>Company:timoon</p>
 *@author 付乐天
 *@version 1.0 */

@Service(value="sample.passage")
public class PassageServiceImpl implements TitleListService {

	@Resource
	private PassageDAO passageDAOImpl;
	
	@Override
	public List<Passage> pagingPassage(Integer requestPage, Integer rows,
			Integer records, final Integer passageType) {
		// TODO Auto-generated method stub
		JqGridParameter parameter=new JqGridParameter();
		
		parameter.putParam("passageType", passageType.toString());
		
		parameter.setBase(rows, requestPage, records);
		
		return this.passageDAOImpl.pagingPassage(parameter);
	}

	@Override
	public Integer countPassage(final Integer passageType) {
		// TODO Auto-generated method stub
		
		JqGridParameter parameter=new JqGridParameter();
		
		parameter.putParam("passageType", passageType.toString());
		
		return this.passageDAOImpl.countPassageByType(parameter);
	}

}
